<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.ufida.com/lfw" prefix="lfw" %>
<%@ taglib uri="http://www.ufida.com/uif" prefix="uif" %> 
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://www.ufida.com/lfwtool" prefix="lfwtool" %> 
<html>
	<head>
		<lfw:base/>
		<lfw:head/>
		<uif:import type="2"/>
		<uif:import pageId="<%= request.getParameter("pageId") %>"/>
		<script type='text/javascript' src='<%= "code/" + request.getParameter("pageId") + "?cache=1" %>'></script>
	</head>
	<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" scroll=no onload="pageBodyScript()" style="background:${lfwtool:getInfo("background")}">
		<lfw:pageModel className="nc.lfw.finance.set.ProxySetPageModel">
			<lfw:layout type="border">
				<lfw:layoutPanel position="top" height="26px">
					<lfw:menubar id="menubar1"/>
				</lfw:layoutPanel>
				<lfw:layoutPanel position="center">
					<lfw:grid id="userproxy_grid"/>
				</lfw:layoutPanel>
			</lfw:layout>
		</lfw:pageModel>
	</body>
</html>
<script>
	function externalInit(){
		var ds = getDataset("userproxy_ds");
		if(ds.getRow(0) != null)
			ds.setRowSelected(0);
		ds.onAfterDataChange = function(event){
			if(event.cellColIndex == this.nameToIndex("pk_operator")){
				var strs = getService("webbx_common_service").getCorpByUserpk(event.currentValue);
				if(strs != null){
					var arr = eval(strs);
					ds.setValueAt(event.cellRowIndex, ds.nameToIndex("pk_corp"),arr[0],false);
					ds.setValueAt(event.cellRowIndex, ds.nameToIndex("pk_corp_mc"),arr[1],false);
				}
			}
		}
	}
	function afterPageInit() {
		//初始化 BillController
		var billController = new BillController("userproxy_ds", false, 1, null, null, null);
		billController.setHeadGrid("userproxy_grid");
		window.billUI = new ListUI(billController);
		
		ButtonManager.getInstance().setOperateStatus(IBillOperate.OP_NOTEDIT);
	 	ButtonManager.getInstance().updateButtons();
	 	var g = getComponent("userproxy_grid");
	 	g.setEditable(false);
	}
</script>